package com.codingman.springbootdemo6;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class Demo5 {
	@AfterThrowing(pointcut = "execution(* Foo2.abc(..))", throwing = "error")
	public void myadvice(JoinPoint jp, Throwable error) throws Throwable {
		System.out.println("Before AfterThrowing");
		System.out.println("Exception is: " + error);
		System.out.println("After AfterThrowing");
	}
}
